import { defHttp } from '/@/utils/http/axios';
import {
  acrivityDetailApiParams,
  createActivityApiParams,
  editActivityDetailApiParams,
} from '/@/api/sys/model/activity';

enum Api {
  GetActivityList = '/activity/getActivityList',
  GetActivityNameList = '/activity/getActivityNameList',
  CreateOrEditActivity = '/activity/createOrEditActivity',
  GetEditArticleDetail = '/activity/editActivity',
  GetActivityDetail = '/activity/getActivityDetail',
}

/**
 * @description: Get user menu based on id
 */

export const getActivityList = () => {
  return defHttp.get({ url: Api.GetActivityList });
};
export const getActivityNameList = () => {
  return defHttp.get({ url: Api.GetActivityNameList });
};

export const createActivity = (params: createActivityApiParams) => {
  return defHttp.post({
    url: Api.CreateOrEditActivity,
    params,
  });
};

export const getActivityDetail = (params: acrivityDetailApiParams) => {
  return defHttp.get({ url: Api.GetActivityDetail, params });
};

export const getEditActivityDetail = (params: editActivityDetailApiParams) => {
  return defHttp.post({ url: Api.GetEditArticleDetail, params });
};
